package com.example.controller;

import com.example.service.UserService;
import com.example.util.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/user/{id}")
    public JsonData info(@PathVariable("id") Long id) {
        return JsonData.buildSuccess(userService.getOne(id));
    }
}
